package com.usefullc.extinguisher.query;

import cn.hutool.core.date.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.usefullc.common.enums.QueryExpressTypeEnum;
import com.usefullc.common.enums.ValidTypeEnum;
import com.usefullc.common.util.DateUtils;
import com.usefullc.system.query.BaseQuery;
import com.usefullc.system.service.component.extend.UsefulField;
import com.usefullc.system.validator.UsefulPropertyVerify;
import com.usefullc.system.service.component.extend.UsefulQueryField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;

/**
 * 消防设备查询实体
 *
 * @author: 星空
 * @date: 2022-09-08
 */
@ApiModel
@Data
public class FireDeviceQuery extends BaseQuery {

//useful_auto_generate_section_start

    @UsefulQueryField()
    @UsefulPropertyVerify(minLen=2, maxLen=32)
    @ApiModelProperty(notes = "编码")
    private String code;

//    @UsefulQueryField()
//    @UsefulPropertyVerify()
//    @ApiModelProperty(notes = "生产日期")
//    private Date gmtBuild;
//
//    @UsefulQueryField()
//    @UsefulPropertyVerify()
//    @ApiModelProperty(notes = "核查时间")
//    private Date gmtAudit;

    @UsefulQueryField()
    @UsefulPropertyVerify(min=-2147483648, max=2147483647)
    @ApiModelProperty(notes = "状态")
    private Integer status;

    @UsefulQueryField()
    @UsefulPropertyVerify()
    @ApiModelProperty(notes = "核查用户")
    private Long auditUserId;

    @UsefulQueryField()
    @UsefulPropertyVerify(min=-2147483648, max=2147483647)
    @ApiModelProperty(notes = "类型")
    private Integer type;

    @UsefulQueryField()
    @UsefulPropertyVerify(minLen=2, maxLen=100)
    @ApiModelProperty(notes = "位置")
    private String position;

    @UsefulQueryField()
    @UsefulPropertyVerify(minLen=2, maxLen=200)
    @ApiModelProperty(notes = "重量/型号")
    private String weightType;

    @UsefulQueryField()
    @UsefulPropertyVerify(minLen=2, maxLen=500)
    @ApiModelProperty(notes = "部位")
    private String area;


    //useful_auto_generate_section_end
    @UsefulQueryField(columnName = "gmtBuild", format = "%Y-%m-%d", type = QueryExpressTypeEnum.GE)
    @ApiModelProperty(notes = "生产日期开始")
    private String gmtBuildStart;

    @UsefulQueryField(columnName = "gmtBuild", format = "%Y-%m-%d", type = QueryExpressTypeEnum.LE)
    @ApiModelProperty(notes = "生产日期结束")
    private String gmtBuildEnd;


    @UsefulQueryField(columnName = "gmtAudit", format = "%Y-%m-%d", type = QueryExpressTypeEnum.GE)
    @ApiModelProperty(notes = "检查日期开始")
    private String gmtAuditStart;

    @UsefulQueryField(columnName = "gmtAudit", format = "%Y-%m-%d", type = QueryExpressTypeEnum.LE)
    @ApiModelProperty(notes = "检查日期结束")
    private String gmtAuditEnd;

    @UsefulQueryField(columnName = "gmtExpire", format = "%Y-%m-%d", type = QueryExpressTypeEnum.GE)
    @ApiModelProperty(notes = "过期日期开始")
    private String gmtExpireStart;

    @UsefulQueryField(columnName = "gmtExpire", format = "%Y-%m-%d", type = QueryExpressTypeEnum.LE)
    @ApiModelProperty(notes = "过期日期结束")
    private String gmtExpireEnd;

//    @DateTimeFormat(pattern = "yyyy-MM-dd")
//    @JsonFormat(pattern = "yyyy-MM-dd")
    @UsefulPropertyVerify(dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(notes = "批量修改生产日期")
    private Date gmtBuildUpdate;

    @UsefulQueryField(type=QueryExpressTypeEnum.LIKE_RIGHT, columnName="position")
    @UsefulPropertyVerify(minLen = 2, maxLen = 100)
    @ApiModelProperty(notes = "位置")
    private String positionLike;

    @UsefulQueryField(type = QueryExpressTypeEnum.IN,columnName = "id")
    @UsefulPropertyVerify()
    @ApiModelProperty(notes = "ID集合")
    private List<Long> ids;

    @UsefulQueryField(type=QueryExpressTypeEnum.LIKE,columnName = "code")
    @UsefulPropertyVerify(minLen=2, maxLen=32)
    @ApiModelProperty(notes = "编码")
    private String codeLike;


}

